#include "search.h"
int order_search(int arr[],size_t len,int key){
    for(int i = 0; i < len;i++){
        if(arr[i] == key){
            return i;
        }
    }
    return -1;
}

int binary_search(int arr[],size_t len,int key){
    int min = 0,max = len;
    while(min < max){
        int mid = (min + max)/2;
        if(arr[mid] == key)return mid;
        if(arr[mid] > key){
            max = mid;
        }else{
            min = mid+1;
        }
    }
    return -1;
}

bool hash_hearch(int arr[],size_t len,int key){
    int hash[101] = {};
    for(int i = 0;i < len;i++){
        hash[arr[i] + 1] = 1;
    }
    return hash[key];
}
